package com.py.framework.scheduler.job;

import java.util.Date;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import com.py.framework.scheduler.common.JobConstants.JobGruop;

/**
 * 任务实体
 * @author Leegern
 * @date   2018年5月7日
 */
public final class Job implements java.io.Serializable {

    /**
	 * 序列号
	 */
	private static final long serialVersionUID = -1815426304568478999L;

	/**
     * 任务ID
     */
    private String jobId;

    /**
     * 任务名称
     */
    private String jobName;

    /**
     * 任务组id
     */
    private String jobGroupId = JobGruop.JOB_DEFAULT_GROUP_ID;
    /**
     * 任务分组
     */
    private String jobGroup = JobGruop.JOB_DEFAULT_GROUP_NAME;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 任务状态, 
     */
    private String jobStatus;
    /**
     * cron表达式
     */
    private String cronExpression;

    /**
     * 简单时间表达式
     */
    private Date simpleExpression;

    /**
     * 任务执行时调用哪个类的方法 包名+类名
     */
    private String jobClassName;

    /**
     * 任务调用的方法名
     */
    private String jobMethodName;

    /**
     * 任务是否有状态(即并发执行同一个任务)
     */
    private boolean isConcurrent = true;

    /**
     * 描述
     */
    private String description;
    
    /**
     * 请求地址
     */
    private String requestUrl;
    
    
    /* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this);
	}

	/**
	 * @return the jobId
	 */
	public String getJobId() {
		return jobId;
	}

	/**
	 * @param jobId the jobId to set
	 */
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	/**
	 * @return the jobName
	 */
	public String getJobName() {
		return jobName;
	}

	/**
	 * @param jobName the jobName to set
	 */
	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	/**
	 * @return the jobGroupId
	 */
	public String getJobGroupId() {
		return jobGroupId;
	}

	/**
	 * @param jobGroupId the jobGroupId to set
	 */
	public void setJobGroupId(String jobGroupId) {
		this.jobGroupId = jobGroupId;
	}

	/**
	 * @return the jobGroup
	 */
	public String getJobGroup() {
		return jobGroup;
	}

	/**
	 * @param jobGroup the jobGroup to set
	 */
	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	/**
	 * @return the createTime
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime the createTime to set
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * @return the updateTime
	 */
	public Date getUpdateTime() {
		return updateTime;
	}

	/**
	 * @param updateTime the updateTime to set
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * @return the jobStatus
	 */
	public String getJobStatus() {
		return jobStatus;
	}

	/**
	 * @param jobStatus the jobStatus to set
	 */
	public void setJobStatus(String jobStatus) {
		this.jobStatus = jobStatus;
	}

	/**
	 * @return the cronExpression
	 */
	public String getCronExpression() {
		return cronExpression;
	}

	/**
	 * @param cronExpression the cronExpression to set
	 */
	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	/**
	 * @return the simpleExpression
	 */
	public Date getSimpleExpression() {
		return simpleExpression;
	}

	/**
	 * @param simpleExpression the simpleExpression to set
	 */
	public void setSimpleExpression(Date simpleExpression) {
		this.simpleExpression = simpleExpression;
	}

	/**
	 * @return the jobClassName
	 */
	public String getJobClassName() {
		return jobClassName;
	}

	/**
	 * @param jobClassName the jobClassName to set
	 */
	public void setJobClassName(String jobClassName) {
		this.jobClassName = jobClassName;
	}

	/**
	 * @return the jobMethodName
	 */
	public String getJobMethodName() {
		return jobMethodName;
	}

	/**
	 * @param jobMethodName the jobMethodName to set
	 */
	public void setJobMethodName(String jobMethodName) {
		this.jobMethodName = jobMethodName;
	}

	/**
	 * @return the isConcurrent
	 */
	public boolean isConcurrent() {
		return isConcurrent;
	}

	/**
	 * @param isConcurrent the isConcurrent to set
	 */
	public void setConcurrent(boolean isConcurrent) {
		this.isConcurrent = isConcurrent;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the requestUrl
	 */
	public String getRequestUrl() {
		return requestUrl;
	}

	/**
	 * @param requestUrl the requestUrl to set
	 */
	public void setRequestUrl(String requestUrl) {
		this.requestUrl = requestUrl;
	}
}